package one.stand.controller;

import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import one.stand.aop.ApiController;
import one.stand.model.ResultModel;
import one.stand.request.SecKillRequest;
import one.stand.response.SecKillResponse;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author: Hongcj
 * @CreateDate: 2019/7/19 11:36
 * @Description:
 */
@RestController
@RequestMapping("/secKill")
public class SecKillController extends BaseController {

    /**
     * 秒杀列表
     * @param request
     * @return
     */
    @PostMapping("/selectKillGoodsList")
    public ResultModel<List<SecKillResponse>> selectKillGoodsList(@RequestBody SecKillRequest request) {
        return secKillService.selectKillGoodsList(request);
    }

    /**
     * 添加秒杀商品配置
     * @param request
     * @return
     */
    @PostMapping("/addKillGoodsInfo")
    public ResultModel<Boolean> addKillGoodsInfo(@RequestBody SecKillRequest request) {
        return secKillService.addKillGoodsInfo(request);
    }

    /**
     * 删除秒杀商品配置
     * @param request
     * @return
     */
    @PostMapping("/delKillGoodsInfo")
    public ResultModel<Boolean> delKillGoodsInfo(@RequestBody SecKillRequest request) {
        return secKillService.delKillGoodsInfo(request);
    }

    /**
     * 秒杀列表编辑
     * @param request
     * @return
     */
    @PostMapping("updateKillGoodsInfo")
    public ResultModel<SecKillResponse> updateGoodsAssembleInfo(@RequestBody SecKillRequest request){
        return secKillService.updateKillGoodsInfo(request);
    }

    /**
     * 发布秒杀商品
     * @param request
     * @return
     */
    @PostMapping("releaseKillGoods")
    public ResultModel<Boolean> releaseKillGoods(@RequestBody SecKillRequest request){
        return secKillService.releaseKillGoods(request);
    }
}
